import httphelper from '@/common/httphelper'
import APIURL from '@/api/apiurl'
import { Toast } from 'mint-ui';
const personlogin = function(model) {  
    if (model == undefined || !model) {
        console.log('that'+that)
        let instance = Toast('参数不正确');
        setTimeout(() => {
            instance.close();
        }, 2000);
        return false;
    }
var promise = new Promise(function(resolve, reject) {
    httphelper(APIURL.AUTH_PERSONLOGIN, model).then(function(data) {
        if (data.ResponseResult != 1) {
            let instance = Toast(data.Msg);
            setTimeout(() => {
                instance.close();
            }, 2000);
            reject(false)
        }
        else
        if (data.ResponseResult==1 && data.Msg=='登录成功')
        {
          resolve(data.Data)
        }
    })

})
  return promise
}

export default personlogin
